-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for partial #30
Conversation
(t/is (= 3 (simple-use)))) | ||
(let [lazily-evaluated (partial inc 2 3)] | ||
#?(:clj (t/is (thrown? Exception (lazily-evaluated))) | ||
:cljs (t/is (thrown? js/Error (lazily-evaluated))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if handling the JS case is needed, but I thought I'd add this. I can remove if that makes more sense.
test/clojure/core_test/partial.cljc
Outdated
(defn test-fn [& args] | ||
(into [] args)) | ||
|
||
(t/deftest test-partial [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about:
- Chaining partials
- Including lazy sequences
- A partial partial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to add some more cases.
For 2, I am pushing up a test that has an infinite sequence and takes from it. If that's not quite right let me know.
For 1, do you mean a sequence of partials? I included what could be a test for that, but also, if that's not quite right let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You got this one
- Looks good
- I was thinking something like
(((partial partial) +) 0 5)
Seemed like a good edge case to cover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally. I adjusted the partial-partial
tests. Lemme know any other adjustments.
Well done! |
No description provided.